.widget-box
  .widget-title
    span.icon: i.icon-user
    h5 组织管理
    span.pull-right= link_to "添加外协企业", new_organ_path, :class => "btn btn-primary"

  .widget-content
    small
      | 可以对组织进行 增加，修改，删除 以及 排序设置（排序号越大，等级越高）
      br
      strong 备注： 本页显示顺序，即排序设置顺序

    table.table
      - @root_organs.each do |organ|
        td
          - organ.depth.downto(1) do |i|
            span style="margin-left: 30px;"
          = link_to organ.name, organ_path(organ)

        td
          = link_to "编辑", edit_organ_path(organ), :class => "btn btn-primary"
          = link_to "添加下级", new_organ_path(:id => organ.id), :class => "btn btn-info"        
          = link_to "删除", organ_path(organ), :class => "btn btn-danger", :method => :delete, :confirm => "你确定要删除吗？"

        - organ.children.each do |child|
          = render :partial => "child", :locals => {:organ => child}
